// src/main/java/com/bookmanager/service/FavoriteService.java
package com.bookmanager.service;

import com.bookmanager.dao.FavoriteDAO;
import com.bookmanager.model.Favorite;
import java.util.List;

public class FavoriteService {
    private FavoriteDAO favoriteDAO = new FavoriteDAO();

    public boolean addFavorite(String userId, int bookId) {
        return favoriteDAO.addFavorite(userId, bookId);
    }

    public boolean removeFavorite(String userId, int bookId) {
        return favoriteDAO.removeFavorite(userId, bookId);
    }

    public List<Favorite> getUserFavorites(String userId) {
        return favoriteDAO.getUserFavorites(userId);
    }

    public boolean isBookFavorite(String userId, int bookId) {
        return favoriteDAO.isBookFavorite(userId, bookId);
    }
}